Skip to content

Exclude recreatable container data from Time Machine - #2412

Open
abdullahtas0 wants to merge 2 commits into
apple:mainfrom
abdullahtas0:exclude-recreatable-data-from-backup
Open

abdullahtas0 wants to merge 2 commits into
apple:mainfrom
abdullahtas0:exclude-recreatable-data-from-backup

Conversation

@abdullahtas0

@abdullahtas0 abdullahtas0 commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

All commits must be signed and verified. Pull requests containing unsigned or unverified commits cannot be built or merged. See the GitHub documentation for instructions.

For all but trivial fixes, make sure to first create a GitHub issue that concisely describes the bug or desired enhancement as justification for the change. Large PRs with no justifying issue will be closed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Fixes #2406.

Image snapshots and container root filesystems are large sparse files. Backup software that honors the exclusion attribute, including Time Machine, backs them up slowly, and that can trigger thinning of older backups. Both can be recreated by pulling the image or creating the container again.

snapshots/ and containers/ receive the sticky backup exclusion only when those directories are first created. An existing directory is left unchanged, so a person who includes it in backups again keeps that choice. Named volume data under volumes/ stays included.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

swift test --filter testNewDirectoryIsExcludedAndExistingChoiceIsKept passed. The test checks that a newly created directory is excluded, that a sibling volumes/ directory is left alone, and that clearing the exclusion and ensuring the directory again does not put the exclusion back.

Sparse image snapshots and container root filesystems make backups stall
and can trigger thinning. Volume data stays included.
@abdodarwish995-collab

Copy link
Copy Markdown

مهمتمت إضافة/تحديث المستندات

Fxxx

@jglogan
jglogan requested a review from dkovba October 22, 2026 17:01
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 22.82%
Integration 69.44%
Combined 78.02%

Comment thread Sources/ContainerPersistence/PathUtils.swift Outdated
Comment thread docs/resource-usage.md Outdated
@dkovba

dkovba commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution 👍

The exclusion is applied only when snapshots or containers is created.
Setting it again on every start replaced a directory a person had included
in backups. The docs now describe that exclusion for backup software in
general, not only Time Machine.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request]: Exclude image snapshots and container rootfs from Time Machine backups

3 participants